package sistema;

import java.rmi.Naming;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.util.List;

import remoto.ContratoTO;
import remoto.IGestion;

public class BD {

	IGestion gestion;
	
    public void LookupService(String uri) {
    	try {
    		String vinculo = "//".concat(uri.trim().concat("/Gestion1"));
			gestion = (IGestion)Naming.lookup (vinculo);
			System.out.println(vinculo);
		} catch (Exception e) {
			javax.swing.JOptionPane.showMessageDialog(null, e.getMessage());
		} 
    }

	public String getConvenioMayorMonto() throws RemoteException {
		String result = gestion.getConvenioDeMayorMonto();
		return result;
	}
	public List<ContratoTO> getContratosDeCoordinadoras() throws RemoteException {
		List<ContratoTO> c = gestion.getContratosDeCoordinadoras();
		return c;
	}
}
